﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Sac.Web;

public partial class Admin_UserModifyPassword : System.Web.UI.Page
{
    

    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnSure_Click(object sender, EventArgs e)
    {
        UserRoleOperate user = new UserRoleOperate();
        string userName = Session["UserName"].ToString();
        string olePassword = textOldPwd.Text.Trim();
        string newPassword=textNewPwd.Text.Trim();
        string message = "";
        if (user.CheckPassword(userName, olePassword))
        {
            if (user.UpdatePasswordByUserName(userName, newPassword))
            {
                message = "密码修改成功，下次登录将使用新密码！";
            }
            else
            {
                message = "密码修改失败，请重新操作！";
            }
        }
        else
        {
            message = "旧密码输入错误，请重新输入！";
        }
        Response.Write("<script>alert('" + message + "')</script>");
    }

    protected void btnCancel_Click(object sender, EventArgs e)
    {

    }
}
